import { Injectable } from '@angular/core';
import { Storage } from '@ionic/storage';
import {HttpClient} from "../../../../providers/httpClient";
import {Config} from "../../../../providers/config";
import {Common} from "../../../../providers/common";

@Injectable()
export class IrpHotStockHomeService {
	constructor(
		public httpClient: HttpClient,
		public config: Config,
    public storage: Storage,
    public common: Common
		) { }

  getDataGridFromRedis() {
	  let postBody = {
      "module": "OAServer",
      "method": "getDataGridFromRedis",
      "params": {

      }
    };
	  return this.httpClient.post(postBody, {
	    isShowLoading: true
    });
  }

  generateDataGrid() {
    let postBody = {
      "module": "OAServer",
      "method": "generateDataGrid",
      "params": {

      }
    };
    return this.httpClient.post(postBody, {
      isShowLoading: true
    });
  }

  refreshDataGrid() {
    let postBody = {
      "module": "OAServer",
      "method": "refreshDataGrid",
      "params": {

      }
    };
    return this.httpClient.post(postBody, {
      isShowLoading: true
    });
  }

  publishDataGrid() {
    let postBody = {
      "module": "OAServer",
      "method": "publishDataGrid",
      "params": {

      }
    };
    return this.httpClient.post(postBody, {
      isShowLoading: true
    });
  }

  rollBackDataGrid() {
    let postBody = {
      "module": "OAServer",
      "method": "rollBackDataGrid",
      "params": {

      }
    };
    return this.httpClient.post(postBody, {
      isShowLoading: true
    });
  }

}
